<?php 
$cfg  = MF_Main::getInstance()->_config;

$this->headLink(array('href' => '/cms/styles/style.css', 'rel' => "stylesheet", 'type' => "text/css"));
$this->layout()->body_attr = '';
if ($this->mode!='plaintext') {
	$this->headScript()
		->appendFile($cfg->content->editor_web_path.'/ckeditor.js')
		->appendScript(<<<EOD
			window.onload = function()
			{
				CKEDITOR.replace( 'data', {
					height: '250px',
					filebrowserBrowseUrl :  '/cms/scripts/ckeditor/pdw_file_browser/index.php',
	        		filebrowserUploadUrl : '/uploader/upload.php',
					toolbar :
							[
								{ name: 'document', items : [ 'Source'/* ,'-','Save','NewPage','DocProps','Preview','Print','-' */,'Templates' ] },
								{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
								{ name: 'editing', items : [ 'Find','Replace','-','SelectAll'/* ,'-','SpellChecker', 'Scayt' */ ] },
								/* { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 
							        'HiddenField' ] }, */
								'/',
								{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
								{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
								'-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
								{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
								{ name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule'/* ,'Smiley','SpecialChar' */,'PageBreak'/* ,'Iframe' */ ] },
								'/',
								{ name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
								{ name: 'colors', items : [ 'TextColor','BGColor' ] },
								{ name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] }
							]
				} );
			};	
EOD
		);
}
?>

<form action="" method="post">
<?php 
/*$cfg  = MF_Main::getInstance()->_config;
include_once $cfg->content->editor_path.'/fckeditor.php';
$oFCKeditor = new FCKeditor('data') ;
$oFCKeditor->BasePath = '/cms/scripts/fckeditor/' ;
$oFCKeditor->Config['FullPage'] = 'true';
$oFCKeditor->Height = 380;
//$oFCKeditor->Config['EditorAreaCSS'] = '/cms/styles/fck/left_column.css';
if ($cfg->content->editor_xml_style!=null) {
	$oFCKeditor->Config['StylesXmlPath'] = $cfg->content->editor_xml_style;
}

if ($cfg->content->editor_template!=null) {
	$oFCKeditor->Config['TemplatesXmlPath'] = $cfg->content->editor_template;
}

$oFCKeditor->Value = $this->data ;
$oFCKeditor->Create();*/
?>
<textarea name="data"><?= $this->data ?></textarea>
<p style="padding: 12px;margin: 0px"><input type="submit" value="Сохранить" class="okButton" />
  <input type="button" class="okButton" value="Отмена" onclick="window.parent.setTimeout('Shadowbox.close()',10)" /></p>
</form>